package com.harassment.interception.data.databases.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import com.harassment.interception.data.databases.entities.WhiteList;

import java.util.List;

@Dao
public interface WhiteListDao {
    @Insert
    void addWhiteList(WhiteList... whiteLists);

    @Delete
    void deleteWhiteList(WhiteList... whiteLists);

    @Update
    void updateWhiteList(WhiteList... whiteLists);

    @Query("select * from white_list order by id desc")
    List<WhiteList> getAllWhiteList();

    @Query("select * from white_list where number = :number")
    WhiteList getWhiteListForNumber(String number);

    @Query("select * from white_list where model = :model order by id desc")
    List<WhiteList> getWhiteListForModel(int model);

}
